<template>
    <div class="add-box">
        <div class="add-title">
            <div>
                <span class="title-icon"></span>
                <span>{{this.manage}}</span>
            </div>
        </div>
        <div class="add-list-box">
            <div class="list-item">
                <div class="list-title">
                    <span class="title-item">标题</span>
                    <div class="input-item">
                        <el-input v-model.trim="model.title" type="text" placeholder="请输入标题"></el-input>
                    </div>
                </div>
                <div class="list-city">
                    <span class="title-item">展示地市</span>
                    <div class="input-item">
                        <el-input v-model="model.cityname" type="text" placeholder="请选择地市" disabled></el-input>
                        <div class="item-city" @click="showCityDialog()">
                            <i class="el-icon-menu"></i>
                        </div>
                    </div>
                </div>
                <div class="list-img-box">
                    <div class="title-item-banner">banner图</div>
                    <div class="list-img-item">
                        <div class="list-item-img">
                            <img :src="imgUrl||model.accessoryid" alt="" class="list-img">
                            <input ref="file_ipt" id="file_ipt" type="file" style="display:none" @change="upload()">
                            <label for="file_ipt" class="add-title-list">点击添加图片</label>
                        </div>
                        <div class="list-color">( 提示:图片尺寸比例 5:2 )</div>
                    </div>
                </div>
                <div class="list-edite-box">
                    <div class="list-edite-title">
                        <div class="item-title" :class="{active:link==='1'}" @click="handleClick('1')">链接</div>
                        <div class="item-title" :class="{active:link==='2'}" @click="handleClick('2')">自定义</div>
                    </div>
                    <div class="list-url-box" v-show="link==='1'">
                        <el-input v-model="model.url" class="item-url" type="text" placeholder="请输入链接内容！"></el-input>
                    </div>
                    <div class="list-myself-box" v-show="link==='2'">
                        <el-form>
                            <el-form-item prop="content" class="editor-box">
                                <!-- <vue-neditor-wrap v-model="model.content" :config="myConfig" :destroy="false" @ready="ready" style="width: 950px;"></vue-neditor-wrap> -->
                            
							<div style="border: 1px solid #ccc;">
							       <Toolbar
							           style="border-bottom: 1px solid #ccc"
							           :editor="editor"
							           :defaultConfig="toolbarConfig"
							           :mode="mode"
							       />
							       <Editor
							           style="height: 300px; overflow-y: hidden;"
							           v-model="model.content"
									   ref="editor"
							           :defaultConfig="editorConfig"
							           :mode="mode"
							           @onCreated="onCreated"
									  @onChange="onChanges"
							       />
							   </div>
							
							</el-form-item>
                        </el-form>
                    </div>
                </div>
                <div class="submit-box">
                    <div class="item-concal" @click="concal()">取消</div>
                    <div class="item-submit" @click="submit()">确定</div>
                </div>
            </div>
        </div>
        <cityDialogCompnent :isVisible="isVisible" :isTip="isTip" :isCheckbox="isCheckbox" :cityData="city" @getSelectCity="getSelectCity" @closeDialog="closeDialog"></cityDialogCompnent>
    </div>
</template>
<style scoped src="./add.css">
</style>
<style src="@wangeditor/editor/dist/css/style.css"></style>
<script src="./add.js">
</script>